package com.oa.service.impl;

import com.oa.pojo.Back;
import com.oa.service.BackService;
import com.oa.mapper.BackMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
* @author zhou
* @description 针对表【back】的数据库操作Service实现
* @createDate 2023-11-03 08:45:41
*/
@Service
public class BackServiceImpl implements BackService{
    @Autowired
    private BackMapper backMapper;
    @Override
    public List<Back> selectAllByIdBacks(Back back) {
        List<Back> backList = new ArrayList<>();
        backList = backMapper.selectAllByIdBacks(back);

        return backList;

    }
    @Override
    public int deleteBack(Integer id) {
        Back back = new Back();
        back.setId(id);
        return backMapper.deleteBack(back);
    }

    @Override
    public int updateBack(Back back) {
        int flag = 0;
        //拿到所有假期信息
        Back back1=new Back();
        List<Back> evectionList = backMapper.selectAllByIdBacks(back1);
        flag= BackMapper.updateBack(back);
        return flag;
    }

    @Override
    public int insertBack(Back back) {
        return 0;
    }

}




